var readline = require('readline-sync')
readline.setDefaultOptions({ prompt: '' })
var readline = readline.prompt
let arr = readline().split(',').map((item) => parseInt(item))
let count = 1
let map = {}
let arrB = [...arr] // 备份一下
arrB.sort((a, b) => a - b)
for (let i = 0; i < arrB.length; i++) {
  if (map[arrB[i]] == undefined) {
    map[arrB[i]] = count
  }
  count++
}
for (let i = 0; i < arr.length; i++) {
  arr[i] = map[arr[i]]
}
console.log(arr.toString());